package com.jn.hilt;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.animation.TranslateAnimation;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.jn.hilt.manager.UserManager;
import com.jn.hilt.qualifier.AppQualifier;
import com.jn.hilt.utils.LogUtils;

import dagger.hilt.android.AndroidEntryPoint;
import jakarta.inject.Inject;

@AndroidEntryPoint
public class SecondActivity extends AppCompatActivity {
    @Inject
    public UserManager mUserManager;
    @Inject
    public UserManager mUserManager1;
    @Inject
    public LogUtils mLogUtils;
    @Inject
    public SharedPreferences mSharedPreferences;

    //注入带限定符的依赖
    @Inject
    @AppQualifier.LinearAnim
    TranslateAnimation linearAnim;

    @Inject
    @AppQualifier.OvershootAnim
    TranslateAnimation overShootAnim;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        mLogUtils.debug("second mUserManager hash == " + mUserManager.hashCode());
        mLogUtils.debug("second mUserManager1 hash == " + mUserManager1.hashCode());
        mLogUtils.debug("second mLogUtils hash == " + mLogUtils.hashCode());

        mLogUtils.debug("second mSharedPreferences hash == " + mSharedPreferences.hashCode());
        mLogUtils.debug("second linearAnim hash == " + linearAnim.hashCode());
        mLogUtils.debug("second overShootAnim hash == " + overShootAnim.hashCode());
    }
}